/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package AdvanceMath;

/**
 * A Row Major class which holds a list of numbers for easy Linear Algebra math
 * @author RomulusAaron
 */
public class Matrix {
    int rows, columns; //N Colums, M rows
    double[][] data;
    
    /**
     * M Rows, N Columns, made with a variable number of arrays, each representing a row.
     * @param M
     * @param N
     * @param numbers 
     */
    public Matrix(int M, int N, double[] ... numbers){
        columns=N;
        rows=M;
        data=new double[M][N];
        try {
            for (int i = 0; i < rows; i++) {
                if(rows<numbers.length){
                    data[i]=numbers[i];
                }else{
                    data[i]=new double[columns];
                }
            }
        } catch (ArrayIndexOutOfBoundsException e) {
            
        }
    }
}
